package webday04;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

//用来做初始化操作的servlet
//在（web容器）tomcat启动时，servlet就会被创建
public class InitializeServlet extends HttpServlet{

	public void init() throws ServletException {
		System.out.println("servlet初始化完成。。。");
		
		//做初始化操作
		//读取全局的servlet初始化参数
		String logFile=getServletContext().getInitParameter("logFile");
		System.out.println(logFile);
		
		getServletContext().setAttribute("logFile", logFile);
	}
}
